package com.qf.test.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qf.test.mapper.DtsAdminMapper;
import com.qf.test.pojo.DtsAdmin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    private DtsAdminMapper adminMapper;
    @Override
    public List<DtsAdmin> findAdminByUserName(String userName) {
        //创建查询条件
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("username",userName);
        //false对应0 true对应1
        queryWrapper.eq("deleted",false);
        //查询结果并返回
        List<DtsAdmin> list = adminMapper.selectList(queryWrapper);
        return list;
    }
}
